<template>
    <van-cell @click="playFn" center :title="name" :label="author + ' - ' + name">
        <template #right-icon>
            <van-icon name="play-circle-o" size="0.6rem"  />
        </template>
    </van-cell>
</template>

<script>
import { } from 'vue'
import { useRouter } from 'vue-router'
export default {
    props: {
        name: String,
        author: String,
        id: Number
    },
    setup(props) {
        const router = useRouter()
        const playFn = () => {
            router.push({
                path: '/Play',
                query: {
                    id: props.id//传递歌曲id
                }
            })
        }
        return {
            playFn
        }
    }
}
</script>
<style scoped>
.van-cell {
    border-bottom: 1px solid lightgray;
}
</style>